const { defineConfig } = require('@vue/cli-service');
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    // 反向代理
    proxy: {
      '/api/koding': {
        // 'https://www.fastmock.site/mock/1e7911c9060e1f07c0545cffc3ef0ad0/vue2-admin'
        target: 'http://kumanxuan1.f3322.net:8001',
        changeOrigin: true,
        // 请求uri和目标uri有一个对应关系
        // 请求/api/login ==> 目标 /login
        pathRewrite: {
          '^/api/koding': '',
        },
      },
      '/api': {
        // 'https://www.fastmock.site/mock/1e7911c9060e1f07c0545cffc3ef0ad0/vue2-admin'
        target: 'https://www.fastmock.site/mock/1e7911c9060e1f07c0545cffc3ef0ad0/vue2-admin',
        changeOrigin: true,
        // 请求uri和目标uri有一个对应关系
        // 请求/api/login ==> 目标 /login
        pathRewrite: {
          '^/api': '',
        },
      },
    },
  },
});
